<template>
  <div class="app-container">
    <el-card class="bug-search">
      <el-form ref="bugQueryForm" :model="bugQueryParams" :inline="true" label-width="68px">
        <span style="font-weight: 700;margin-right: 12px;width: 100px;">缺陷报告</span>
        <el-select v-model="bugQueryParams.project" placeholder="请选择">
          <el-option
            v-for="item in statusOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
        <el-form-item prop="id" style="margin-left:10px;margin-bottom:0px;">
          <el-input v-model="bugQueryParams.bugId" placeholder="请输入bugID" style="width: 200px" />
        </el-form-item>
        <el-form-item style="margin-bottom:0px;">
          <el-button type="primary" icon="el-icon-document-checked" size="mini" @click="handleBugQuery">预处理</el-button>
        </el-form-item>
      </el-form>
      <el-form ref="fileQueryForm" :model="bugQueryParams" :inline="true" label-width="68px" style="margin-top: 12px;">
        <span style="display: inline-block;font-weight: 700;margin-right: 12px;width: 64px;">源文件</span>
        <el-select v-model="fileQueryParams.project" placeholder="请选择">
          <el-option
            v-for="item in statusOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
        <el-form-item prop="commit" style="margin-left:10px;margin-bottom:0px;">
          <el-input v-model="fileQueryParams.commit" placeholder="请输入commit" style="width: 200px" />
        </el-form-item>
        <el-form-item prop="path" style="margin-left:10px;margin-bottom:0px;">
          <el-input v-model="fileQueryParams.path" placeholder="请输入文件路径" style="width: 200px" />
        </el-form-item>
        <el-form-item style="margin-bottom:0px;">
          <el-button type="primary" icon="el-icon-document-checked" size="mini" @click="handleFileQuery">预处理</el-button>
        </el-form-item>
      </el-form>
    </el-card>

    <el-row :gutter="32" style="margin-top: 30px;">
      <el-col :xs="36" :sm="36" :lg="12">
        <el-card class="content">
          <div slot="header" class="clearfix">
            <h3>数据预处理前</h3>
          </div>
          <h4>{{ bugInfo.summary }}</h4>
        </el-card>
      </el-col>
      <el-col :xs="36" :sm="36" :lg="12">
        <el-card class="content">
          <div slot="header" class="clearfix">
            <h3>数据预处理后</h3>
          </div>
          <h4>{{ bugInfo.description }}</h4>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>

export default {
  name: 'Documentation',
  data() {
    return {
      statusOptions: [{
        value: '选项1',
        label: 'Tomcat'
      }, {
        value: '选项2',
        label: 'SWT'
      }, {
        value: '选项3',
        label: 'JDT'
      }],
      bugQueryParams: {
        project: 'Tomcat',
        bugId: ''
      },
      fileQueryParams: {
        project: 'Tomcat',
        commit: '',
        path: ''
      },
      // defaultBugInfo: { summary: '列表', description: 'hahahah' },
      bugInfo: {}
    }
  },
  /* mounted() {
    this.getInfo()
  }, */
  methods: {
    /*     getInfo() {
      const storedInfos = localStorage.getItem('bugInfo')
      this.bugInfo = storedInfos ? JSON.parse(storedInfos) : this.defaultBugInfo
    }, */
    handleBugQuery() {
      this.bugInfo = { summary: '列', description: 'hahahah123' }
    },
    handleFileQuery() {
      this.bugInfo = { summary: '列啊哈哈哈哈', description: 'hahahah3' }
    }
  }
}

</script>

<style lang="scss" scoped>
.file-list{
  padding-top:10px;

}
.content{
  height:64vh;
}
/* .localization-container {
  margin: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;

  .document-btn {
    flex-shrink: 0;
    display: block;
    cursor: pointer;
    background: black;
    color: white;
    height: 60px;
    padding: 0 16px;
    margin: 16px;
    line-height: 60px;
    font-size: 20px;
    text-align: center;
  }
} */
</style>
